
#include <ProbabilityImpl.h>

ProbabilityImpl::ProbabilityImpl(float a,float b)
:Probability(a,b)
{
	if( a > 1)
		probabilityA =1;
	else if(a < 0)
		probabilityA =0;
	else
		probabilityA = a;

	if( b > 1)
		probabilityB =1;
	else if(b < 0)
		probabilityB =0;
	else
		probabilityB = b;
}

float ProbabilityImpl::getAAndB()
{
	return probabilityA*probabilityB;
}

float ProbabilityImpl::getAOrB()
{
	return probabilityA + probabilityB - probabilityA*probabilityB;
}

float ProbabilityImpl::getNotA()
{
	return 1 - probabilityA;
}

ProbabilityImpl::~ProbabilityImpl()
{

}

